/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.x3.purchasing.order;

import com.x3.purchasing.common.ClassConnection;
import java.util.List;

/**
 *
 * @author kris
 */
public class OrderDAOImpl implements OrderDAO {

    public OrderDAOImpl() {
        ClassConnection.getTransactionProxyFactoryBean().setTarget(this);
    }

    public void insert(Order order) throws Exception {
        String sql = "INSERT INTO orders(id,tanggal,status,operator_id) VALUES(?,?,?,?)";
        ClassConnection.getJdbc().update(sql, new Object[]{
                    order.getId(),
                    order.getTanggal(),
                    order.getStatus(),
                    order.getOperator().getId()
                });
    }

    public void update(Order order) throws Exception {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public void delete(int id) throws Exception {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public Order get(int id) throws Exception {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public List<Order> gets() throws Exception {
        throw new UnsupportedOperationException("Not supported yet.");
    }
}
